home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Format CD 22
/
Amiga Format AFCD22 (Jan 1998, Issue 106).iso
/
-readerstuff-
/
d_keletsekis
/
tools
/
config.gc
< prev
next >
Wrap
Text File
|
1997-10-03
|
3KB
|
109 lines
G4C
; Ripped this off CliMaster..
WINBIG -1 -1 505 163 "Players Configuration"
wintype 11110001
BOX 0 0 0 0 out button
xonload
gosub Config.gc loadprefs
guiopen Config.gc
xonclose
ifexists file env:.dir.prefs
delete env:.dir.prefs
endif
guiquit Config.gc
; -------------- the listview
XLISTVIEW 6 4 493 124 "" cfg_lvline "" 0 txt
gadid 1
gadfont topaz.font 8 000
cgf_lvnum = $$LV.LINE
cutvar cfg_lvline cut word 1 cfg_var ; get variable name
cutvar cfg_lvline cut word 1 "" ; cut off the = character
extract cfg_lvline unquote cfg_prog ; clean-up program name
update Config.gc 2 $cfg_prog
setgad Config.gc 2 on
; -------------- The buttons
XBUTTON 10 145 100 14 "Save"
gosub Config.gc saveprefs
guiquit Config.gc
XBUTTON 115 145 100 14 "Use"
guiquit Config.gc
XBUTTON 455 145 20 14 "«"
lvuse Config.gc 1
lvmove -5
XBUTTON 475 145 20 14 "»"
lvuse Config.gc 1
lvmove 5
XTEXTIN 10 130 486 14 "" cfg_prog "" 512
gadid 2
gosub Config.gc updatelist
XBUTTON 365 145 87 14 "Browse"
reqfile -1 -1 300 -40 "Select File..." load cfg_prog SYS:
update Config.gc 2 $cfg_prog
setgad Config.gc 2 on
gosub Config.gc updatelist
; -------------- Routines
xroutine loadprefs
setvar .dir.prefs ""
gosub Config.gc addprefs
lvuse Config.gc 1
lvchange env:.dir.prefs
xroutine saveprefs
setvar .dir.prefs "G4C - Players\n\nxOnLoad\n"
gosub Config.gc addprefs
append env:.dir.prefs "GuiQuit Players\n"
copy env:.dir.prefs guis:tools/prefs/players
xroutine addprefs
append env:.dir.prefs '*DEF.EDITOR = \"$*DEF.EDITOR\"\n'
append env:.dir.prefs '*DEF.ILBM = \"$*DEF.ILBM\"\n'
append env:.dir.prefs '*DEF.ANIM = \"$*DEF.ANIM\"\n'
append env:.dir.prefs '*DEF.GIF = \"$*DEF.GIF\"\n'
append env:.dir.prefs '*DEF.JPG = \"$*DEF.JPG\"\n'
append env:.dir.prefs '*DEF.GFX = \"$*DEF.GFX\"\n'
append env:.dir.prefs '*DEF.PAINT = \"$*DEF.PAINT\"\n'
append env:.dir.prefs '*DEF.GFXCON = \"$*DEF.GFXCON\"\n'
append env:.dir.prefs '*DEF.8SVX = \"$*DEF.8SVX\"\n'
append env:.dir.prefs '*DEF.MOD = \"$*DEF.MOD\"\n'
append env:.dir.prefs '*DEF.GUIDE = \"$*DEF.GUIDE\"\n'
append env:.dir.prefs '*DEF.LHA = \"$*DEF.LHA\"\n'
append env:.dir.prefs '*DEF.ZIP = \"$*DEF.ZIP\"\n'
append env:.dir.prefs '*DEF.UNZIP = \"$*DEF.UNZIP\"\n'
append env:.dir.prefs '*DEF.HEX = \"$*DEF.HEX\"\n'
append env:.dir.prefs '*DEF.PP = \"$*DEF.PP\"\n'
append env:.dir.prefs '*DEF.PPM = \"$*DEF.PPM\"\n'
append env:.dir.prefs '*DEF.TGA = \"$*DEF.TGA\"\n'
append env:.dir.prefs '*DEF.PNG = \"$*DEF.PNG\"\n'
append env:.dir.prefs '*DEF.FONT = \"$*DEF.FONT\"\n'
xroutine updatelist
setvar $cfg_var '$cfg_prog'
setvar .dir.prefs ""
gosub Config.gc addprefs
lvuse Config.gc 1
lvchange env:.dir.prefs